package cn.stylefeng.guns.modular.time.mapper;

import cn.stylefeng.guns.modular.time.entity.AppUser;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * APP 用户 Mapper
 */
public interface AppUserMapper extends BaseMapper<AppUser> {
    default Long getAppUserId(Long userId) {
        AppUser appUser = selectOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getSysUserId, userId));
        return appUser != null ? appUser.getUserId() : null;
    }
}